<!--
Zeke Elder - zbe@andrew.cmu.edu
Amal Chemmany - achemman@andrew.cmu.edu
Nishant Kumar - nkumar1@andrew.cmu.edu
15-637
4/2/2012
-->
<html>
<head>
<title>Welcome to FitHub!</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/fithub.js">
	
</script>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:if test="${user != null}">
<c:redirect url="showHome.do"/>
</c:if>
</head>
<body>

	<div id="header" class="header_container">
		<br /> <a href="./login.do"><img src="./images/fithub.jpg" /></a>
	</div>
	<div class="body_container">
		<div>
			<div id="loginbox_fit">
				<table>
					<c:forEach var="error" items="${errors}">
						<tr>
							<h3 style="color: red">${error}</h3>
						</tr>
					</c:forEach>
				</table>

				<form name="login" action="login.do" method="post">
					<br /> <label>username</label><input type="text" name="username">
					<label>password </label><input type="password" name="password">
					<input type="submit" value="login">
				</form>
			</div>
			<div id="loginbox_openid" class="hiddenDiv">
				<form name="login" action="openidlogin" method="post">
					<br /> <label>openid</label><input type="text"
						name="openid_identifier"> <input type="submit"
						value="login">
				</form>
			</div>
			<input onclick="displaythislogin('loginbox_openid')" type="image"
				src="./images/openid.png" name="image" width="20" height="20">
			<input onclick="displaythislogin('loginbox_fit')" type="image"
				src="./images/fit.png" name="image" width="20" height="20">
		</div>
		<br /> <br /> Welcome to FitHub - a social networking website where
		users can create workouts, set weight-loss goals, and track progress.<br />
		<br /> Not a member? <input type="button" onclick="displayblock()"
			value="Register Now"></input>

		<div class="centered_div">
			<div id="register_div"
				<c:choose>
					<c:when test="${registerForm==null}">
	class="hiddenDiv" />
	</c:when>
					<c:otherwise>
	class="visibleDiv" />
	</c:otherwise>
	</c:choose>
				<h2> Registration</h2>
				<form name="login" action="register.do" method="post">
			<table>
			<tbody>
			<tr >
		   	<td colspan="2">User Name :</td> <td> <input type="text" name="username" value="${registerForm.username}"/> </td>
		  	</tr>
				<tr>
								<td colspan="2">First Name :</td>
								<td><input type="text" name="firstName"
									value="${registerForm.firstName}" /></td>
							</tr>
							<tr>
								<td colspan="2">Last Name :</td>
								<td><input type="text" name="lastName"
									value="${registerForm.lastName}" /></td>
							</tr>
		  	<tr >
		   	<td colspan="2">Password :</td> <td> <input type="password" name="password" /> </td>
		  	</tr>
		  	<tr >
		   	<td colspan="2">Password Confirmation :</td> <td> <input type="password" name="passwordConf" /> </td>
		  	</tr>
		  	<tr >
		  	<tr >
		   	<td colspan="2">Email Address :</td> <td> <input type="text" name="email" value="${registerForm.email}"/> </td>
		  	</tr>
		   	<td colspan="2">Age :</td> <td> <input type="text" name="age" value="${registerForm.age}"/> </td>
		  	</tr>
		  	<tr >
		   	<td colspan="2">Weight (lbs) :</td> <td> <input type="text" name="weight" value="${registerForm.weight}"/> </td>
		  	</tr>
		  	<tr >
		   	<td colspan="2">Timezone :</td> <td> <input type="text" name="timeZone" value="${registerForm.timeZone}"/> </td>
		  	</tr>
		  		<tr >
		   	<td colspan="3" class="form_submit" > <input type="submit" value="register" /> </td>
		  	</tr>
			</table>
		</form></div>
</body>
</html>